<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>送好礼</title>
    <link rel="stylesheet" type="text/css" href="css/css/stylesheets/defaultcss.css">
    <link rel="stylesheet" type="text/css" href="css/css/stylesheets/index.css">
    <script src="js/flex.js"></script>
    <script src="js/jquery-1.9.1.min.js"></script>
</head>

<body>
    <div class="index_content">
        <div class="banner1">
            <img src="./img/banner1.png" alt="">
        </div>
        <div class="position_box">
            <div class="banner2">
                <a href="https://acts.richinhz.com/rui_cheng_integral_web/cgg"><img src="./img/banner2.png" alt=""></a>
            </div>
            <div class="linebox ">
                <img src="./img/line.png" alt="">
            </div>
            <ul class="tabList">
                <li class="active">
                    <a href="javascript:void(0)">
                        <div class="icon icon1">
                        </div>
                        <div class="text text1">
                            精选
                        </div>
                    </a>
                </li>
                <li>
                    <a href="./coupon.html">
                        <div class="icon icon5">
                        </div>
                        <div class="text text5">
                            优惠券
                        </div>
                    </a>
                </li>
                <li>
                    <a href="./education.html">
                        <div class="icon icon2">
                        </div>
                        <div class="text text2">
                            教育
                        </div>
                    </a>
                </li>
                <li>
                    <a href="./liren.html">
                        <div class="icon icon3">
                        </div>
                        <div class="text text3">
                            丽人
                        </div>
                    </a>
                </li>
                <li>
                    <a href="./credit_card.html">
                        <div class="icon icon4">
                        </div>
                        <div class="text text4">
                            信用卡
                        </div>
                    </a>
                </li>
            </ul>
            <ul class="equity_list" id="equity_list">
            </ul>
            <!--<div class="line2">
                <img src="./img/line1.png" alt="">
            </div>-->
        </div>
    </div>

</body>

</html>

<script type="text/javascript">
    $.ajax({
        url: 'https://acts.richinhz.com/rui_cheng_integral_web/staticWeb/prizeList', //请求访问地址
        dataType: 'json', //访问格式，如：json、html等
        timeout: 10000, //请求访问时间
        data: {
            actId: 9
        },
        contentType: false,
        processData: true,
        type: 'get', //请求访问方式，如post、get
        success: function (data) {
            console.log(data)
            var data = data.data
            var equity_list_msg = '';
            var nowArr = []
            for (var i = 0; i < data.length; i++) {
                if (data[i].template.instruction == '0') {
                    nowArr.push(data[i]);
                    nowArr = nowArr.sort(compare('template'))
                }
            }

            function compare(property) {
                return function (a, b) {
                    var value1 = a[property].details;
                    var value2 = b[property].details;
                    return value1 - value2;
                }
            }
            for (var i = 0; i < nowArr.length; i++) {
                equity_list_msg +=
                    '<li>         ' +
                    '    <a href="' + nowArr[i].couponUrl + '">    ' +
                    '        <img src="https://pics.richinhz.com/' + nowArr[i].template.icon +
                    '" alt="">                                                                        ' +
                    '    </a>                                                      ' +
                    '</li>       '
            }
            $("#equity_list").append(equity_list_msg)
        },
    });
    // var equity_list = [{
    //     "image": "./img/jingxuan/j5.png",
    //     "link": 'https://m.you.163.com/lead/share/8EA64CB545TWpZeE5UTXdOek00TnprPQ==299CB31059A68823AEF56C?_stat_from=web_pd_invite_wxfriend_0&from=singlemessage&isappinstalled=0'
    // }, {
    //     "image": "./img/jingxuan/j2.png",
    //     "link": 'https://s.click.taobao.com/U0bV2Lw'
    // }, {
    //     "image": "./img/jingxuan/j3.png",
    //     "link": 'https://s.click.taobao.com/PVz83Nw'
    // }, {
    //     "image": "./img/jingxuan/j4.png",
    //     "link": 'https://weex.kaola.com/activity/pages/jhsjwuk6pages1.html?noklappbanner=2&inviter=INVITE_yX6CeNa6xID5ZG9f-9WSWfIWJNDP-8lhkULZBOQHHb0s4vBhZ7uXRLNFsulMT1Bpm4JfwHC2_L1n4pSqo6Npgw&zn=tupianerweima&shareOs=iOS&datid=__da_230bb323_5691a863f1c33c80&shareTo=wx'
    // }, {
    //     "image": "./img/jingxuan/j1.png",
    //     "link": 'https://sale.suning.com/all/cs22/middle.html?pageCode=tokensupermarket&userToken=KHSLmuLPIT&minip=false'
    // }, {
    //     "image": "./img/jingxuan/j6.png",
    //     "link": 'https://s.click.taobao.com/8QuT2Lw'
    // }];
</script>